<?php
require_once('common.inc.php');
require_once(_INC_PATH.'database.php');
if(!strpos($_SERVER['HTTP_REFERER'], '87dianping.com'))die("illegal path");
$url = $_POST['url'];
if(preg_match('#/corporation/(\d+)/$#i', $url, $matches)){
	$corId = intval($matches[1]);
	if($corId > 0)
	{
		$db = new database();
		$sql = "update `tbl_statistic` set visit_total=visit_total+1 where cor_id='$corId'";//echo $sql;
		$db->query($sql);
	}
}elseif(preg_match('#/corporation/(\d+)/index.html$#i', $url, $matches)){
	$corId = intval($matches[1]);
	if($corId > 0)
	{
		$db = new database();
		$sql = "update `tbl_statistic` set visit_total=visit_total+1 where cor_id='$corId'";//echo $sql;
		$db->query($sql);
	}
}elseif(preg_match('#/tech/(\d+).html#i', $url, $matches)){
	$techId = intval($matches[1]);
	if($techId > 0)
	{
		$db = new database();
		$sql = "update `tbl_tech` set pv=pv+1 where id='$techId'";//echo $sql;
		$db->query($sql);
	}
}else{
	echo "error_url";
}
echo $_SERVER['HTTP_REFERER'];
die;
?>